<%@ Page language="c#" Inherits="PHSRAG.Insight21.COI.AddCoIUsers" CodeFile="AddCoIUsers.aspx.cs" %>
<%@ Register TagPrefix="cc2" Namespace="PHSRAG.WebControls" Assembly="PHSRAG.WebControls" %>
<%@ Register TagPrefix="cc1" Namespace="PHSRAG.Insight21.InsightWebControls" Assembly="PHSRAG.Insight21.InsightWebControls" %>
<HTML>
	<HEAD>
		<TITLE>COI - Search/Add users</TITLE>
		<LINK href="../Insight21.css" type="text/css" rel="stylesheet">
		<script language="javascript" type="text/javascript">
		function Search(searchId)
		{
			if (window.event.keyCode == 13)
			{
				searchId.click()
				window.event.returnValue = false;
			}
		}
		</script>
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<table class="Container" width="100%">
				<tr>
					<td><asp:panel id="headerSection" runat="server">
							<TABLE class="Header" width="100%">
								<TR>
									<TD>
										<cc1:header id="header" runat="server" CssClass="Header"></cc1:header></TD>
								</TR>
								<TR>
									<TD>
										<cc1:CoISubNavigation id="coiSubNavigation" runat="server"></cc1:CoISubNavigation></TD>
								</TR>
							</TABLE>
							<br>
							<TABLE class="PlaceBar" width="100%">
								<TR>
									<TD>
										<CC2:BREADCRUMB id="breadCrumb" runat="server" HighlightCurrentPage="true"></CC2:BREADCRUMB></TD>
								</TR>
							</TABLE>
							<TABLE width="100%">
								<TR>
									<TD>&nbsp;</TD>
								</TR>
							</TABLE>
						</asp:panel>
						<TABLE class="FormsManagement" cellSpacing="10" cellPadding="10" width="100%" bgColor="#ffffff">
							<TR>
								<TD><cc2:expandingpanel id="addCOIUsersPanel" runat="server" ExpansionToggler="addCOIUserToggler">
										<STATICTEMPLATE>
											<TABLE class="Search">
												<TR>
													<TD>
														<TABLE id="expandedSearch" runat="server" width="100%">
															<TR>
																<TD><table width="100%">
																		<tr>
																			<td>
																				<cc1:CoISearch id="coISearch" ViewOptionVisible="false" ShowHierarchyType="false" ViewExternalUsersVisible="true" runat="server" ></cc1:CoISearch></td>
																			<td>
																				<cc1:CommonSearch id="commonSearch" HideAllCommonControls="true" OnSearch="OnSearch" OnClearSelection="OnClearSelection"
																					runat="server" Module="COI" EmbeddedSearchControl="true" ExtendedSearchControl="CoISearch"></cc1:CommonSearch></td>
																		</tr>
																	</table>
																</TD>
															</TR>
															<TR style="Display: none">
																<TD class="PanelSeparator"></TD>
															</TR>
															<TR>
																<TD>
																	<cc2:ExpansionToggler id="addCOIUserToggler" runat="Server" ExpandedImage="~/Images/Arrow_DN.gif" CollapsedImage="~/Images/Arrow_RT.gif"
																		ExpandedLinkCaption="Hide Instructions" CollapsedLinkCaption="Show Instructions"></cc2:ExpansionToggler></TD>
															</TR>
														</TABLE>
													</TD>
												</TR>
											</TABLE>
										</STATICTEMPLATE>
										<DYNAMICTEMPLATE>
											<TABLE class="SearchDynamic">
												<TR>
													<TD>&nbsp;</TD>
												</TR>
												<tr>
													<td>
														&nbsp;&nbsp;Use this page to search and add user(s) to a hierarchy(Level).Also 
														the user has to be assigned with permission(Role) by selecting the role from 
														the respective dropdown. To add a user to a level, follow the instructions 
														mentioned below.
														<ol>
															<li>
																Enter the known parameters in one/more of the above textbox.
															</li>
															<li>
																Click Search.
															</li>
															<li>
																Add a role(Permission) to each of the user wanted to be added.
															</li>
															<li>
																Add the users by selecting the left most checkbox in the result set returned 
																and click "add Selected".
															</li>
														</ol>
													</td>
												</tr>
											</TABLE>
										</DYNAMICTEMPLATE>
									</cc2:expandingpanel></TD>
							</TR>
							<tr>
								<td><cc1:searchcriteriadisplay id="searchCriteriaDisplay" runat="server"></cc1:searchcriteriadisplay></td>
							</tr>
						</TABLE>
						<table width="100%" align="center" cellspacing="0">
							<tr>
								<td>									
									<table>
										<tr>
											<td><cc2:postbackguard id="postbackGuard" runat="server"></cc2:postbackguard></td>
										</tr>
									</table>
									<table>
										<tr>
											<td><cc2:annunciator id="annunciator" runat="server"></cc2:annunciator></td>
										</tr>
									</table>
									<table>
										<tr>
											<td><cc2:setfocus id="setFocus" runat="server" FocusControl="lastName"></cc2:setfocus></td>
										</tr>
									</table>
									<table width="100%" cellspacing="10">
										<tr>
											<td><cc2:activityindicator id="activityIndicator" runat="server"></cc2:activityindicator></td>
										</tr>
									</table>
									<asp:panel id="gridContainer" Visible="False" Runat="server">
										<TABLE width="100%" cellspacing="0">
											<TR>
												<TD>
													<TABLE class="DataTitle" width="100%">
														<TR>
															<TD>&nbsp;Search Results</TD>
														</TR>
													</TABLE>
												</TD>
											</TR>
											<TR>
												<TD>
													<cc2:pager id="topPager" runat="server"></cc2:pager></TD>
											</TR>
											<TR>
												<TD>
													<asp:datagrid cellspacing="0" id="searchResults" runat="server" CssClass="DataGrid" AllowCustomPaging="true" AutoGenerateColumns="False"
														Width="100%" AllowSorting="true" AllowPaging="true">
														<FooterStyle CssClass="DataGridHeader"></FooterStyle>
														<AlternatingItemStyle CssClass="DataGridAlternatingItem"></AlternatingItemStyle>
														<ItemStyle CssClass="DataGridItem"></ItemStyle>
														<HeaderStyle CssClass="DataGridHeader"></HeaderStyle>
														<Columns>
															<asp:BoundColumn SortExpression="LastName" HeaderText="Last Name" DataField="LastName" ReadOnly="True"></asp:BoundColumn>
															<asp:BoundColumn SortExpression="FirstName" HeaderText="First Name" DataField="FirstName" ReadOnly="True"></asp:BoundColumn>
															<asp:BoundColumn SortExpression="Username" HeaderText="Username" DataField="Username" ReadOnly="True"></asp:BoundColumn>
															<asp:BoundColumn SortExpression="Organization" HeaderText="Institution > Department > Unit" DataField="Organization"
																ReadOnly="True"></asp:BoundColumn>
															<asp:TemplateColumn HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
																<ItemTemplate>
																	<asp:CheckBox Runat="server" ID="selectUser" AutoPostBack="False"></asp:CheckBox>
																</ItemTemplate>
															</asp:TemplateColumn>
														</Columns>
														<PagerStyle Visible="False"></PagerStyle>
													</asp:datagrid></TD>
											</TR> 
											<TR>
												<TD>
													<cc2:pager id="bottomPager" runat="server"></cc2:pager></TD>
											</TR>
										</TABLE>
										<TABLE height="5%" width="100%">
											<TR align="right">
												<TD>
													<asp:ImageButton id="addtoList" runat="server" ImageUrl="../Images/b_add_to_list.gif"></asp:ImageButton>&nbsp;&nbsp;&nbsp;
												</TD>
											</TR>
										</TABLE>
									</asp:panel>
									<br>
									<asp:panel id="selectedUsersContainer" Visible="False" Runat="server">
										<TABLE width="100%" cellspacing="0">
											<TBODY>
												<TR>
													<TD>
														<TABLE class="DataTitle" width="100%" cellspacing="0">
															<TR>
																<TD>&nbsp;Selected User(s)</TD>
															</TR>
														</TABLE>
													</TD>
												</TR>
												<asp:datagrid id="selectedUsers" runat="server" CssClass="DataGrid" AllowPaging="true" AllowSorting="False"
													Width="100%" AutoGenerateColumns="False" AllowCustomPaging="true">
													<AlternatingItemStyle CssClass="DataGridAlternatingItem"></AlternatingItemStyle>
													<ItemStyle CssClass="DataGridItem"></ItemStyle>
													<HeaderStyle CssClass="DataGridHeader"></HeaderStyle>
													<Columns>
														<asp:BoundColumn SortExpression="LastName" HeaderText="Last Name" DataField="LastName" ReadOnly="True"></asp:BoundColumn>
														<asp:BoundColumn SortExpression="FirstName" HeaderText="First Name" DataField="FirstName" ReadOnly="True"></asp:BoundColumn>
														<asp:BoundColumn SortExpression="Username" HeaderText="Username" DataField="Username" ReadOnly="True"></asp:BoundColumn>
														<asp:BoundColumn SortExpression="Organization" HeaderText="Institution > Department > Unit" DataField="Organization"
															ReadOnly="True"></asp:BoundColumn>
														<asp:TemplateColumn HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
															<ItemTemplate>
																<asp:CheckBox Runat="server" ID="addToHierarchy" AutoPostBack="False"></asp:CheckBox>
															</ItemTemplate>
														</asp:TemplateColumn>
													</Columns>
													<PagerStyle Visible="False"></PagerStyle>
												</asp:datagrid></td>
							</tr>
						</table>
						</asp:panel>
						<br>
						<table height="5%" width="100%">
							<tr align="right">
								<td><asp:ImageButton id="cancel" runat="server" ImageUrl="../Images/b_cancel.gif"></asp:ImageButton>&nbsp;
									<asp:ImageButton id="addExternals" runat="server" ImageUrl="../Images/b_add_external.gif"></asp:ImageButton>&nbsp;
									<asp:ImageButton id="save" runat="server" Visible="False" ImageUrl="../Images/b_add_hierarchy.gif"></asp:ImageButton>&nbsp;
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			</TD></TR></TBODY></TABLE>
		</form>
		</SCRIPT>
	</body>
</HTML>
